package com.usian.behavior.controller;

import com.usian.api.behavior.ApBehaviorEntryControllerApi;
import com.usian.behavior.service.ApBehaviorEntryService;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/behavior_entry")
public class ApBehaviorEntryController implements ApBehaviorEntryControllerApi {

    private ApBehaviorEntryService apBehaviorEntryService;

    /**
     * @RequestParam("userId")  通过什么方式传值？  http://ip:端口号/api/v1/behavior_entry?userId = 1
     * @param userId
     * @param equipmentId
     * @return
     */
    @Override
    @GetMapping("/one")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam("userId") Integer userId,@RequestParam("equipmentId") Integer equipmentId) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
